home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d13 / ibm_bios.arc / IBM_BIOS.DOC next >
Text File  |  1987-10-03  |  14KB  |  271 lines

  1.  
  2.           I B M   P C   B I O S   S e r v i c e   R o u t i n e s  
  3.  
  4.            Adapted from IBM Technical Reference Release 11/08/82
  5.                              by Roy Smith
  6. ----------------------------------------------------------------------------
  7. Vector     Interrupt                               BIOS Entry
  8. Address    Number    Name                         label
  9. ----------------------------------------------------------------------------
  10. 00-03      0         Divide by Zero                D11
  11. 04-07      1         Single Step                   D11
  12. 08-0B      2        Nonmaskable                   NMI_INT
  13. 0C-0F      3         Breakpoint                    D11
  14. 10-13      4         Overflow                      D11
  15. 14-17      5         Print Screen    &              PRINT_SCREEN
  16. 18-1B      6         Reserved                      D11
  17. 1C-1F      7         Reserved                      D11
  18.  
  19. ---- Hardware Service Rutines ---------------------------------------------
  20. 20-23      8         Time of Day Service           TIMER_INT
  21. 24-27      9         Keyboard Service              KB_INT
  22. 28-2B      A         Reserved                      D11
  23. 2C-2F      B         Communications Service COM2:  D11
  24. 30-33      C         Communications Service COM1:  D11
  25. 34-37      D         Disk Service                  D11
  26. 38-3B      E         Diskette Service              DISK_INT
  27. 3C-3F      F         Printer Service               D11
  28. ----------------------------------------------------------------------------
  29.  
  30. 40-43      10        Video I/O                     VIDEO_IO
  31. 44-47      11        Equipment Check               EQUIPMENT
  32. 48-4B      12        Memory                        MEMORY_SIZE_DETERMINE
  33. 4C-4F      13        Diskette/Disk IO             DISKETTE_IO
  34. 50-53      14        Communications                RS232_IO
  35. 54-57      15        Cassette                      CASSETTE_IO
  36. 58-5B      16        Keyboard I/O                  KEYBOARD_IO
  37. 5C-5F      17        Printer                       PRINTER_IO
  38. 60-63      18        Resident BASIC                F600:0000
  39. 64-67      19        Bootstrap                     BOOT_STRAP
  40. 68-6B      1A        Time of Day                   TIME_OF_DAY
  41. 6C-6F      1B        Keyboard Break                DUMMY_RETURN
  42. 70-73      1C        Timer Tick (18.2 per second)  DUMMY_RETURN
  43. 74-77      1D        Video Initialization          VIDEO_PARMS
  44. 78-7B      1E        Diskette Operating Parameter DISK_BASE
  45. 7C-7F      1F        Video Graphics Characters     0
  46. ^L
  47. +-------------------------------------------------------------------------+
  48. |     I B M   P C    B I O S   I n t e r f a c e   R o u t i n e s         |
  49. +--------------------------------------------------------------------------+
  50. Intr Func  In        Out        Comments
  51.   #  (AH)  Regs      Regs
  52.  
  53. 10   --------------- Video I/O ---------------------------------------------
  54. ---  0  Set CRT Mode
  55.            AL                   0=40 x 25 Black & white     1= 40 x 25 Color
  56.                                 2=80 x 25 Black & white     3= 80 x 25 Color
  57.                                 4=320 x 200 Medium resolution color
  58.                                 5=320 x 200 Medium resolution black & white
  59.                                 6=640 x 200 High reslution black & white
  60. ---  1  Set Cursor Type
  61.            CH                   Start scan line (0-7 C/G, 0-14 Mono)
  62.            CL                   End scan line (set start to 20H for no curs.)
  63. ---  2  Set Cursor Position
  64.            DH,DL                Row, column (0,0 = Home)
  65.            BH                   Video page
  66. ---  3  Read Cursor Position
  67.            BH                   Video page
  68.                      DH,DL      Row, column (0,0 = Home)
  69. ---  4  Read Light Pen
  70.                      AH         0=Light pen not trig, 1=valid info in regs:
  71.                      DH,DL      Row, column of character LP position
  72.                      CH         Raster line
  73.                      BX         Pixel column (0-319 med-res,0-619 hi-res)
  74. ---  5  Select Active Page
  75.            AL                   New page (0-7 for 4x25,0-3 for 80x25)
  76. ---  6  Scroll Active Page Up
  77. ---  7  Scroll Active Page Down
  78.            AL                   Nuber of lines to scroll (0 if entire screen)
  79.            CH,CL                Row, column of upper left corner
  80.            DH,DL                Row, column of lower right corner
  81.            BH                   Attribute to use in blanked lines
  82. ---  8  Read Attribute / Character at current cursor position
  83.            BH                   Video page
  84.                      AL         Character read
  85.                      AH         Attribute of char (alpha modes only)
  86. ---  9  Write Attribute / Character at current cursor position
  87.            BH                   Video page
  88.            CX                  Count of characters to write
  89.            AL                   Character to write
  90.            BL                   Attribute to write
  91. ---  A  Write Character only at current cursor position
  92.            BH                   Video page
  93.            CX                   Count of characters to write
  94.            AL                   Character to write
  95. ---  B  Set Color Palette
  96.            BH                   Palette color ID being set
  97.            BL                  Color value to be used with that color ID
  98. ---  C  Write Dot
  99.            DX,CX                Row, column nmber
  100.            AL                   Color value (If bit 7=1, value is OR'ed in)
  101. ---  D  Read Dot
  102.            DX,CX                Row, column number
  103.                      AL         Dot read
  104. ---  E  Write Teletype to Active Page
  105.            AL                   Character to write
  106.            BL                   Foreground color in graphics mode
  107. ---  F  Get Current Video State
  108.                      AL         Mode currently set (see func. 0)
  109.                      AH         Columns on screen
  110. ^L
  111. +--------------------------------------------------------------------------+
  112. |     I B M   P C    B I O S   I n t e r f a c e   R o u t i n e s         |
  113. +--------------------------------------------------------------------------+
  114. Intr Func  In        Out        Comments
  115.   #  (AH)  Regs      Regs
  116.  
  117. 11   ------------------------------------------------+
  118. Intr Func  In        Out        Comments
  119.   #  (AH)  Regs      Regs
  120.  
  121. 11   --------------- Equipment ---------------------------------------------
  122.            None
  123.                      AX         Equipment attached : Bits set as follows
  124.                                       A H               A L
  125.                                 0 0 X 0 0 0 0 X   0 0 0 0 0 0 X 0
  126.                                 ---   - -----     --- --- ---   -
  127.                                  1    2   3        4   5   6    7
  128.  
  129.                              1  Number of printer
  130.                              2  Game I/O
  131.                              3  RS232 cards
  132.                              4  Drives
  133.                              5  Initial video mode
  134.                              6  System board RAM
  135.                              7  IPL from diskette
  136.  
  137. 12   -------------- Memory Size ---------------------------------------------
  138.            None
  139.                      AX         Number of bytes in Kbytes
  140.  
  141. 13   ------------- Diskette I/O ---------------------------------------------
  142. ---  0  Reset Diskette System
  143.            None      None       Hard reses all diskette drives, recal req'd
  144. ---  1  Read Diskette Status
  145.                      AL         Status byte : Bits set as follows
  146.                                 80        Attachment failed to respond
  147.                                 40        Seek operation failed
  148.                                 20        NEC controller failure
  149.                                10        Bad CRC on diskette read
  150.                                 09        Attempt to DMA across a 64k bound
  151.                                 08        DMA overrun on operation
  152.                                 04        DMA overrun on operation
  153.                                 03        Write attempted on wrt prot disk
  154.                                 02        Address mark not found
  155.                                 01        Bad command passed to diskete I/O
  156.  
  157. ---  2  Read the desired sectors into memory
  158. ---  3  Write the desired sectors from memory
  159. ---  4  Verify te desired sectors
  160. ---  5  Format the desired track 
  161.  
  162.            DL                   Drive number (0-3)
  163.            DH                   Head number
  164.            CH                   Track number
  165.            CL                   Secto number
  166.            AL                   Number of sectors (not used for format)
  167.            ES:BX                Addrsss of buffer (not used for verify)
  168.  
  169.                      AH         Status of operation (see above)
  170.                      CY         1 if failed, 0 if ok
  171. ^L
  172. +--------------------------------------------------------------------------+
  173. |     I B M   P C    B I O S   I n t e r f a c e   R o u t i n e s         |
  174. +--------------------------------------------------------------------------+
  175. Intr Func  In        Out        Comments
  176.   #  (AH)  Regs      Regs
  177.  
  178. 14   ------------ RS-232 I/O -----------------------------------------------
  179. ---  0  Initialize Communications Port
  180.            DX                   Interface card (0=COM1:, 1=COM2:)
  181.            AL                   Parameters to set up : Bit are as follows
  182.                                       A L
  183.                                 0 0 0 0 0 0 0 0 
  184.                                --- - --- -----
  185.                                  1  2  3    4
  186.  
  187.                              1  Word length (10=7 bit, 11=8 bit)
  188.                              2  Stopbits (0=1, 1=2)
  189.                             3  Parity (00=none, gth (10=7 bit, 11=8 bit)
  190.                              2  Stopbits (0=1, 1=2)
  191.                              3  Parity (00=none, 01=odd, 11=even)
  192.                              4  Baud (000=110, 001=150, 010=300, 011=600,
  193.                                    100=1200, 101=2400, 110=4800, 111=9600)
  194.  
  195.                      AH         Set as in status (call 3)
  196. ---  1  Send Character to 100=1200, 101=2400, 110=4800, 111=9600)
  197.  
  198.                      AH        Set as in status (call 3)
  199. ---  1  Send Character to Communications Line
  200.            DX                   Interface card (0=COM1:, 1=COM2:)
  201.            AL                   Character to send
  202.                      AH         Set as in status (call 3)
  203. ---  2  Recieve Character from Communications Line
  204.            DX                   Interface card 0=COM1:, 1=COM2:)
  205.                      AL         Character
  206.                      AH         0 if no error, set as sttus if nonzero
  207. ---  3  Get Communications Status 
  208.            DX                   Interface card (0=COM1:, 1=COM2:)
  209.                      AH         Line status : Bits set as follows
  210.                                 80        Time out
  211.                                 40        Transmit shift reg empty
  212.                                 20        Transmit holding reg empty
  213.                                 10        Break detect
  214.                                 08        Framing error
  215.                                 04        Parity error
  216.                                 02        Overrun error
  217.                                 01        Data ready
  218.  
  219.                      AL         Modem status : Bits set as follows
  220.                                 80        Recieved line signal detect
  221.                                 0        Ring indicator
  222.                                 20        Data set ready
  223.                                 10       Clear to send
  224.                                 08        Delta recieved line signal detect
  225.                                 04        Trailing edge ring detector
  226.                                 02        Delta data set ready
  227.                                 01        Delta clear to send 
  228.  
  229. 15   ----------- Cassette I/O ----( Obsolete )------------------------------
  230. ^L
  231. +--------------------------------------------------------------------------+
  232. |     I B M  P C    B I O S   I n t e r f a c e   R o u t i n e s         |
  233. +--------------------------------------------------------------------------+
  234. Intr Func  In        Out        Comments
  235.   #  (AH)  Regs      Regs
  236.  
  237. 16   ----------- Keyboard I/O -----------------------------------------------
  238. ---  0  Read Next Character 
  239.                      AL         Caracter struck
  240.                      AH         Scan code of key
  241. ---  1  Check Typeahead Status
  242.                     ZF         1 if no key available, 0 if key available
  243.                      AL,AH      Character/Scan code if availabl. Keystroke
  244.                                 remains in buffer.
  245. ---  2  Get Current Shift Status
  246.                      AL         Shift flag status : Bits set as follows
  247.                                 80        Insert state
  248.                                 40        Caps lock state
  249.                                 20        Num lock state
  250.                                10        Scroll lock state
  251.                                 08        Alt shift is depressed
  252.                                 04        Ctl shift is depressed
  253.                                 02        Left shift is depressed
  254.                                 01        Right shift is depressed
  255.  
  256. 17   ----------- Printer I/O ------------------------------------------------
  257. ---  0  Print Character
  258.            DX                   Printer to be used (0,1,2)
  259.            AL                   Character to print
  260.                      AH         Status set as in call 2
  261. --  1  Initialize Printer Port
  262.            DX                   Printer to be used (0,1,2)
  263.                      AH         Status set as in call 2
  264. ---  2  Get Printer Status
  265.            DX                   Printer to be used (0,1,2)                     AH         Printer status : Bits set as follows
  266.                                 80        Not buy (ready?)
  267.                                 40        Acknowledge
  268.                                 20        Out of paper
  269.                                 10        Selected
  270.                                 08        I/O error
  271.                                 01